package com.jincp.image.pick.bean;

import java.io.File;
import java.io.Serializable;

/**
 * Created by droidNinja on 29/07/16.
 */
public class BaseFile implements Serializable {
    public int id;        //file的id
    public String name;      //file的名字
    public String path;      //file的路径
    public long size;           //file的大小

    public BaseFile(int id, String name, String path, long size) {
        this.id = id;
        this.name = name;
        this.path = path;
        this.size = size;
    }

    public String getTitle() {
        return new File(this.path).getName();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof BaseFile)) return false;

        BaseFile baseFile = (BaseFile) o;

        return id == baseFile.id;
    }
}
